﻿<Window x:Class="SEToolbox.Views.WindowResourceReport"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:commands="clr-namespace:SEToolbox.Services"
        xmlns:controls="clr-namespace:SEToolbox.Controls"
        xmlns:converters="clr-namespace:SEToolbox.Converters"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        ResizeMode="CanResize" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" WindowStyle="ThreeDBorderWindow"
        Title="Resource Report"  Height="600" Width="700" MinWidth="260" MinHeight="200" Icon="/SEToolbox;component/app.ico" Style="{StaticResource DefaultWindowStyle}"
        commands:DialogService.IsRegisteredView="True"
        commands:DialogCloser.DialogResult="{Binding CloseResult}"
        FocusManager.FocusedElement="{Binding ElementName=uxInitialElement}">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <converters:BusyMouseConverter x:Key="BusyMouseConverter" />
    </Window.Resources>
    <Window.Cursor>
        <Binding Path="IsBusy" Converter="{StaticResource BusyMouseConverter}"/>
    </Window.Cursor>
    <Grid IsEnabled="{Binding IsActive}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid Margin="8">
                <WebBrowser commands:BrowserBehavior.Html="{Binding ReportHtml}" />
            </Grid>
            <Grid Grid.Row="1" Margin="8">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0"  MinWidth="120" Command="{Binding GenerateCommand}" Content="Generate Report" IsDefault="True" Name="uxInitialElement"/>
                <Button Grid.Column="1" Margin="8,0,0,0" MinWidth="80" Command="{Binding ExportCommand}" HorizontalAlignment="Left" Content="Export" Style="{StaticResource DropDownMenuButton}">
                    <i:Interaction.Behaviors>
                        <commands:ButtonDropDownMenuBehavior />
                    </i:Interaction.Behaviors>
                    <!--<Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Export"/>
                            <Path x:Name="BtnArrow" Margin="4" VerticalAlignment="Center" Width="6" Fill="#FF527DB5" Stretch="Uniform" HorizontalAlignment="Right" Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z "/>
                        </StackPanel>
                    </Button.Content>-->
                    <Button.ContextMenu>
                        <ContextMenu HorizontalAlignment="Right">
                            <MenuItem Header="Clipboard" Command="{Binding CopyCommand}"/>
                            <MenuItem Header=".txt file" Command="{Binding ExportTextCommand}"/>
                            <MenuItem Header=".html file" Command="{Binding ExportHtmlCommand}"/>
                            <MenuItem Header=".xml file" Command="{Binding ExportXmlCommand}"/>
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
                <ProgressBar Grid.Column="2" Margin="8,0,8,0" Value="{Binding Progress}" Maximum="{Binding MaximumProgress}" />
                <Button Grid.Column="3" Width="90" Command="{Binding CloseCommand}" Content="Close" HorizontalAlignment="Right" IsCancel="True"/>
            </Grid>
        </Grid>
        <controls:BusyIndicator Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</Window>
